package com.zxw.设计模式.结构型.代理模式.JDK代理.静态代理.proxy;

import com.zxw.设计模式.结构型.代理模式.JDK代理.静态代理.service.IUserService;

/**
 * @projectName: util-cloud
 * @package: com.zxw.设计模式.结构型.代理模式.JDK代理.静态代理.proxy
 * @className: UserServiceProxy
 * @author: zhangxuewei
 * @description: TODO
 * @date: 2023/6/12 17:36
 * @version: 1.0
 */
public class UserServiceProxy implements IUserService {

    private IUserService userService;

    public UserServiceProxy(IUserService userService) {
        this.userService = userService;
    }

    @Override
    public String save() {
        System.out.println("前置处理");
        String msg = userService.save() +" 代理";
        System.out.println("后置处理");
        return msg;
    }
}
